package com.itheima.day03_streamControl;

import java.util.Random;
import java.util.Scanner;

public class Demo15_caishuziyouxi {
    public static void main(String[] args) {
        Random random = new Random();
        int luckNumber = random.nextInt(100) + 1;

        Scanner scanner = new Scanner(System.in);
        while (true){
            System.out.println("请您输入您要猜测的数字：1-100之间");
            int guessNumber = scanner.nextInt();
            if (guessNumber > luckNumber){
                System.out.println("猜大了");
            }else if (guessNumber < luckNumber){
                System.out.println("猜小了");
            }else{
                System.out.println("猜中了， 去买单吧。。。");
                break;
            }
        }
    }
}
